package com.market.manage.controller;

import com.market.manage.service.RecordService;
import com.market.manage.vo.ChartVo;
import com.market.po.Result;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 人脸识别考勤
 */
@CrossOrigin
@RestController
@RequestMapping(value = "/record")
public class RecordController {
    @Resource
    private RecordService recordServiceImpl;

    @GetMapping("/getRecord")
    public Result getRecord(Long userId) {
        return recordServiceImpl.getRecord(userId);
    }

    @GetMapping("/getData")
    public Result getData(String time, String username, Integer pageIndex, Integer pageSize) {
        return recordServiceImpl.getData(time, username, pageIndex, pageSize);
    }

    @GetMapping("/charts")
    public ChartVo charts() {
        return recordServiceImpl.charts();
    }

}
